import Layout from "@/pages/Layout/layout"
import Wallpaper from "@/pages/Wallpaper/wallpaper"
import Dashboard from "@/pages/Home/dashboard"
import LoginPage from "@/pages/Login"
import NotFound from "@/pages/NotFound"
import Mail from "@/pages/System/Mail"
import { createBrowserRouter } from 'react-router-dom'
import { AuthRoute } from "@/components/authroute/AuthRoute"

const router = createBrowserRouter([
    {
        path: "/",
        element: 
        <AuthRoute>
            <Layout />
        </AuthRoute>,
        children: [{
            index: true,
            element: <Dashboard />
        }, {
            path: "/wallpaper",
            element: <Wallpaper />
        }, {
            path: "/system/mail/mail-account",
            element: <Mail />
        }, {
            path: "*",
            element: <NotFound />
        }]
    },
    {
        path: '/login',
        element: <LoginPage />
    }
])

export default router